package com.naiterui.ehp.bs.esign.controller.openapi;

import com.naiterui.ehp.bp.support.advice.IgnoreResponseEntityWrap;
import com.naiterui.ehp.bp.support.exception.BusinessException;
import com.naiterui.ehp.bs.esign.api.ISignService;
import com.naiterui.ehp.bs.esign.api.vo.FaceNoticeVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Description e签宝回调
 * @Author gongbaoqiang
 * @Date 2019/12/25 6:10 PM
 */
@Slf4j
@RequestMapping("esign/openapi")
@RestController
public class OpenEsignController {
    @Autowired
    private ISignService signService;

    @RequestMapping("face/notice")
    @IgnoreResponseEntityWrap
    public void faceNotice(@RequestBody FaceNoticeVO noticeVO) {
        log.info("视频认证结果通知：noticeVO={}", noticeVO);
    }

    /**
     * 删除签名账号，主要是e签宝平台特殊情况用
     * @param accountId
     * @throws BusinessException
     */
    @DeleteMapping("account/delete")
    public void deleteAccount(String accountId) throws BusinessException {
        signService.deleteAccount(accountId);
    }
}
